package com.xiaoye.qbproject.controller.qbzyk;

import com.xiaoye.qbproject.controller.base.BaseController;
import com.xiaoye.qbproject.domain.AjaxResult;
import com.xiaoye.qbproject.service.BlbcZbRelationService;
import com.xiaoye.qbproject.vo.BlbcAndZbRelationVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author : ChenYao
 * @version : 1.0
 * @description : 编成编组和装备的关系控制器
 * @create : 2025-01-02 11:46
 */
@RestController
@RequestMapping("/blbcZbRelation")
public class BlbcZbRelationController extends BaseController {
    @Autowired
    private BlbcZbRelationService blbcZbRelationService;

    /**
     * @description: 设置编成编组和装备的关系
     * @author: ChenYao
     * @return: com.xiaoye.qbproject.domain.AjaxResult
     * @ceateDate: 2025-01-02 11:25
     */

    @PostMapping("setBlbcAndZbRelation")
    public AjaxResult setBlbcAndZbRelation(@RequestBody BlbcAndZbRelationVo blbcAndZbRelationVo) {
        blbcZbRelationService.setBlbcAndZbRelation(blbcAndZbRelationVo);
        return success("设置成功");
    }

    /**
     * @param blbcId
     * @description: 根据兵力编程编组id  获取编成编组和装备的关系
     * @author: ChenYao
     * @return: com.xiaoye.qbproject.domain.AjaxResult
     * @ceateDate: 2025-01-02 12:53
     */

    @GetMapping("/getBlbcAndZbRelation/{blbcId}")
    public AjaxResult getBlbcAndZbRelation(@PathVariable String blbcId) {
        return success(blbcZbRelationService.getBlbcAndZbRelation(blbcId));
    }
}
